<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p id="para"></p>
    <script>
        var user = {
            firstName: "邓",
            lastName: "杭",
            age: 20,
            location: "New York",
            getName: function() {
                return this.firstName + " " + this.lastName;
            }
        }
        document.getElementById("para").innerHTML = user.getName();
    </script>
</body>

</html>